<div id="corps">
	<?php

	print "Gestion des albums : <br/>";
	
	// Affichage des albums
	if ( count ( $data->albumList ) == 0) {
		print "Aucun album existant, veuillez créer un nouvel album.<br/>";
	} else {
		print "<ul>";
		foreach ( $data->albumList as $iter ) {
			
			print "<li>Album <a href='index.php?controller=gestionAlbums&action=index&albumId=". $iter->getId () ."'/> " .$iter->getNom(). "</a> ( " . $iter->getNbPhotos () . " images ) ";
			
			if ($iter->getNbPhotos () > 0) {
				print "- <a href=\"index.php?controller=gestionAlbums&action=vider&albumId=" . $iter->getId () . "\"/>Vider</a>";
			}
			print " - <a href=\"index.php?controller=gestionAlbums&action=supprimer&albumId=" . $iter->getId () . "\"/>Supprimer</a>";
			print " - <a href=\"index.php?controller=gestionAlbums&action=editer&albumId=" . $iter->getId () . "\"/>Editer</a>";
			print "</li>";
		}
		
		print "</ul>";
	}
	print $data->action_msg;
	print "Creer un nouvel album :";
	print "<form method='POST' action='index.php?controller=gestionAlbums&action=creer' >";
	print "<input name='name' type='text' width='250'/>";
	print "<input type='submit' value='Valider' />";
	print "</form>";
	print $data->creation_msg;
	if (isset($data->showEditionAlbum)) {
		print "<hr/>";

		print "Gestion des images :<br/>";
		if ( $data->albumCourant->getNbPhotos() <= 0) {
			print "Aucune image dans l'album !<br/>";
		} else {
			print "Images présentes dans l'album";
			print "<ul>";
				$count = count($data->imagesAffectees);
				$nb_iter=1;
				foreach ($data->imagesAffectees as $iter) {
					print "<li>";
					print "<img src=\"".$iter->getURL()."\" width='250px' height='250px'>";
					print " [ <a href='index.php?controller=gestionAlbums&action=desaffecterImageAlbum&albumId=".$data->albumCourant->getId()."&imageId=". $iter->getId ()."&position=".$nb_iter."'>X</a> ] ";
					if ($nb_iter !=1 ) {
						print "	[ <a href='index.php?controller=gestionAlbums&action=changerOrdre&albumId=".$data->albumCourant->getId()."&imageId=". $iter->getId ()."&sens=up&position=".$nb_iter."''>^</a> ] "	;
					} if($nb_iter != $count) {
						print "	[ <a href='index.php?controller=gestionAlbums&action=changerOrdre&albumId=".$data->albumCourant->getId()."&imageId=". $iter->getId ()."&sens=down&position=".$nb_iter."''>v</a> ] ";
					}
					print "</li>";
					$nb_iter++;
				} 
			print "</ul>";
		}
		print "Ajouter une photo :";
		print "<form method='POST' action=index.php?controller=gestionAlbums&action=ajouterImage>";
		print "<select name='idImage'>\n";
		foreach ($data->imagesDisponibles as $iter) {
			print "<option value='".$iter->getId()."'>".$iter->getURL()."</option>"; 
		}
		print "</select>";
		print "<input type='hidden' value='".$data->albumCourant->getId()."' name='albumCourant' />";
		print "<input type='submit' value='Ajouter' /><br>";
		print $data->ajout_msg."<br/>";
		
	}
	/*
	 * <ul> <li>Photo nom_1 - Categorie Test [ X ] [ v ] </li> <li>Photo nom_2 - Categorie Test [ X ] [ v ] [ ^ ] </li> <li>Photo nom_3 - Categorie Test [ X ] [ ^ ] </li> </ul> Ajouter une photo : <hr/> Consulter l'album : < Ici s'affiche
	 */

	?>
</div>